﻿<local:DocumentBase x:Class="WPFExcelReport.SDTAB0305"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="768" Width="1366" 
                    FontSize="16"
                    Loaded="Window_Loaded"
                    Title="SDTAB0305"  
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="453" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" MaxWidth="1300"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0"
            Grid.ColumnSpan="4" Orientation="Horizontal" >
            <TextBlock FontSize="18"  Height="22"   Width="60" Name="txt1" Margin="0,0,0,0" Text="生产单"  />
            <TextBox Background="Yellow"  FontSize="18"  Height="36"   Width="40" Name="txtABPAUFKRS" CharacterCasing="Upper" Margin="10,0,0,0" Text="" />
            <TextBox Background="Beige" FontSize="18" Height="36"    Width="80" Name="txtABPAUFLFD"   Margin="10,0,0,0" Text="" />
            <TextBlock FontSize="18"  Height="22"   Width="115" Name="txt2" Margin="10,0,0,0" Text="染厂简称编号"  />
            <TextBox Background="Azure"  FontSize="18"  Height="36"   Width="67" Name="txtFACTORY" CharacterCasing="Upper" Margin="5,0,0,0" Text="" MaxLength="2"/>
            <TextBlock FontSize="18"  Height="22"   Width="200" Name="txt3" Margin="10,0,0,0" Text="业务员（登录系统用户）"  />
            <TextBox Background="Beige"  FontSize="18"  Height="36"   Width="119" Name="txtSTAFF" CharacterCasing="Upper" Margin="5,0,0,0" Text="" MaxLength="8"/>
            <Button FontSize="18" Content="查询" Height="40" Margin="20,0,0,0" Name="butGetData" Click="btnQuery_Click" Width="56"></Button>
            <Button Content="打印"  FontSize="18" Height="40" Margin="20,0,0,0"  Name="btnPrint" Width="60" Click="btnPrint_Click"/>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.ColumnSpan="4" >
            <StackPanel>
                <WrapPanel>
                    <TextBlock Text="生产单"></TextBlock>
                    <TextBlock Text="{Binding Path=ABPAUFKRS, Source=vwABPOS}" Width="40" Background="Beige"></TextBlock>
                    <TextBlock Text="{Binding Path=ABPAUFLFD, Source=vwABPOS}" Width="80" Background="Azure"></TextBlock>
                    <TextBlock Text="{Binding Path=ABPAUFPOS, Source=vwABPOS}" Width="40" Background="Beige"></TextBlock>
                </WrapPanel>
                <WrapPanel>
                <StackPanel>
                    <TextBlock Text="进展:   每行最多30个汉字或60个字符"></TextBlock>
                    <TextBox Margin="50,0,0,0" HorizontalAlignment="Left" Text="{Binding Path=ABABEM1, Source=vwABPOS, Converter={StaticResource ResourceKey=gb2312}, Mode=TwoWay}" Width="300"  Background="White"></TextBox>
                    <TextBox Margin="50,0,0,0" HorizontalAlignment="Left" Text="{Binding Path=ABABEM2, Source=vwABPOS, Converter={StaticResource ResourceKey=gb2312}, Mode=TwoWay}" Width="300" Background="White"></TextBox>
                </StackPanel>
                    <Button FontSize="18" Content="更新" Height="40" Margin="20,0,0,0" x:Name="btnRefresh" Click="btnRefresh_Click" Width="61" />
                </WrapPanel>
            </StackPanel>
            <DataGrid CanUserReorderColumns="True"  
                  CanUserResizeRows="True" CanUserSortColumns="True"                  
                  AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" 
                  IsSynchronizedWithCurrentItem="True" Visibility="Visible"
                  SelectionUnit="FullRow"                  
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}"  x:Name="ABPOSDataGrid" 
                  Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="染厂" Binding="{Binding LSLIEFNA}" MinWidth="30" Width="SizeToCells"/>
                    <DataGridTextColumn Header="染厂名称" Binding="{Binding FACTORY, Converter={StaticResource ResourceKey=gb2312}}" MaxWidth="120"/>
                    <DataGridTextColumn Header="业务员" Binding="{Binding ABKARTSB}" MinWidth="40" Width="SizeToCells"/>
                    <DataGridTextColumn Header="业务员名称" Binding="{Binding STAFF, Converter={StaticResource ResourceKey=gb2312}}" MinWidth="40" Width="SizeToCells"/>
                    <DataGridTextColumn Header="生" Binding="{Binding ABPAUFKRS}" MinWidth="20" Width="SizeToCells"/>
                    <DataGridTextColumn Header="产" Binding="{Binding ABPAUFLFD}" MinWidth="40" Width="SizeToCells"/>
                    <DataGridTextColumn Header="单" Binding="{Binding ABPAUFPOS}" MinWidth="20" Width="SizeToCells"/>
                    <DataGridTextColumn Header="品种" Binding="{Binding ABPART}" Width="80" />
                    <!--DataGridTextColumn Header="版本" Binding="{Binding ABPVAR}" Width="40"/-->
                    <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}" Width="60"/>
                    <DataGridTextColumn Header="颜色" Binding="{Binding COLOR, Converter={StaticResource ResourceKey=gb2312}}" Width="80"/>
                    <DataGridTextColumn Header="整理" Binding="{Binding ABPBESCHICH}" Width="60"/>
                    <DataGridTextColumn Header="坯布mtr" Binding="{Binding Path=ABPSOLLMENGE1}" Width="SizeToCells"/>
                    <DataGridTextColumn Header="成品长度" Binding="{Binding Path=ABPSOLLMENGE7}" Width="SizeToCells"/>
                    <DataGridTextColumn Header="开始" Binding="{Binding ABPSTARTDAT}"  MinWidth="60" Width="SizeToCells" />
                    <DataGridTextColumn Header="交期" Binding="{Binding ABPLIEFDAT}" MinWidth="60" Width="SizeToCells" />
                    <DataGridTextColumn Header="进展" Binding="{Binding ABABEM1, Converter={StaticResource ResourceKey=gb2312}}" Width="200"/>
                    <DataGridTextColumn Header="进展" Binding="{Binding ABABEM2, Converter={StaticResource ResourceKey=gb2312}}" Width="200"/>
                </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
    </Grid>
</local:DocumentBase>
